﻿using System;
using System.IO.Ports;
namespace SerialPortsController
{
    public class IOManager
    {
        protected string[] PortsName;
        protected SerialIOUtility.Router[] Ports;

        void EnumSerialPorts()
        {
            string[] ports_list = System.IO.Ports.SerialPort.GetPortNames();
            Ports = new SerialIOUtility.Router[ports_list.Length] ;
            for (int i = 0; i < ports_list.Length; i++)
            {
                PortsName[i] = ports_list[i];
                Ports[i].SetDeviceName(ports_list[i]);
                Ports[i].Init();
            }
        }
    }
}